package com.woniuxy.microfundservice.controller;

import com.alibaba.fastjson.JSONObject;
import com.woniuxy.bean.ResultBean;
import com.woniuxy.microfundservice.bean.trend.FundTrendMsg;
import com.woniuxy.microfundservice.bean.trend.TrendRes;
import com.woniuxy.microfundservice.service.FundTrendService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * Auther: yeyang  <br/>
 * Date: 2021/4/9 0009:上午 10:12  <br/>
 * Description:
 */
@RefreshScope
@Api(tags = "基金走势图")
@RestController
@RequestMapping(value = "/trend", produces = MediaType.APPLICATION_JSON_VALUE)
public class FundTrendController {

    @Resource
    private FundTrendService fundTrendService;


    //获取走势图
    @ApiOperation("获取走势图")
    @GetMapping("/gettrend")
    public ResultBean getTrend(@RequestParam("fundCode") int fundCode, @RequestParam("startDate")String startDate, @RequestParam("endDate")String endDate){

        return fundTrendService.getTrend(fundCode, startDate, endDate);
    }
}
